package com.bdqn.Text;

import com.bdqn.dao.BaseDao;
import com.bdqn.dao.NewDao;
import com.bdqn.dao.NewTypeDao;
import org.junit.Assert;
import org.junit.Test;

import java.sql.ResultSet;
import java.sql.SQLException;

/***
 * 测试底层jdbc
 */
public class Text_JDBC1 {


    @Test
    public void Text() throws Exception {
        String title=NewTypeDao.getlist().get(0).getName();
        System.out.println(title);
    }

    @Test
    public void textObj() throws Exception {
        String str=NewDao.GetObj("1").getTitle();
        System.out.println(str);
    }

    @Test
    public void getlist() throws Exception {
        ResultSet set= BaseDao.getResultSet("select * from newtable",
                new Object[]{});
        while (set.next())
        {
            System.out.println(set.getString("title"));
        }
        BaseDao.close();
    }
    @Test
    public void update() throws Exception {
        int a=BaseDao.update("insert into newtable(title) value(?)",
                new Object[]{"标题99"});
        System.out.println(a);
    }
}
